<template>
	<view class="billDetails">
		<u--form labelPosition="left" labelWidth='80' :model="dataForm" ref="uForm">
			<view class="header ">
				<view class="top box">
					<view class="image">
						<image v-if="dataForm.type=='吃喝'" src="../../static/bookeepingIcon/chihewanle.png" mode="">
						</image>
						<image v-if="dataForm.type=='交通'" src="../../static/bookeepingIcon/bus-alt.png" mode=""></image>
						<image v-if="dataForm.type=='娱乐'" src="../../static/bookeepingIcon/yuleAPP.png" mode=""></image>
						<image v-if="dataForm.type=='酒店'" src="../../static/bookeepingIcon/hotel.png" mode=""></image>
						<image v-if="dataForm.type=='水电'" src="../../static/bookeepingIcon/shuidianjiaofei.png" mode="">
						</image>
						<image v-if="dataForm.type=='房租'" src="../../static/bookeepingIcon/fangzu.png" mode=""></image>
						<image v-if="dataForm.type=='买菜'" src="../../static/bookeepingIcon/huluobu.png" mode=""></image>
						<image v-if="dataForm.type=='购物'" src="../../static/bookeepingIcon/shopping2.png" mode="">
						</image>
						<image v-if="dataForm.type=='门票'" src="../../static/bookeepingIcon/menpiao-copy.png" mode="">
						</image>
						<span>{{dataForm.type}}</span>
					</view>
					<view class="money">
						{{dataForm.money}}
					</view>
				</view>
				<view class="buttom box">
					<u-form-item label="备注:" prop="remark" ref="item1">
						{{dataForm.remark}}
					</u-form-item>
				</view>
			</view>
			<view class="founder">
				<view class="title box">
					付款人
				</view>
				<view class="people box">
					<view class="image">
						<image style="border-radius: 50%;" :src="dataForm.founderImg" mode=""></image>
						<span>{{dataForm.founder}}</span>
					</view>
					<view class="money">
						<span
							style="color:#008c8c;margin-right:10rpx;font-weight: normal;font-size: 28rpx;">支出</span>{{dataForm.money}}
					</view>
				</view>
			</view>
			<view class="founder">
				<view class="title box">
					参与人
				</view>
				<view class="people box" v-for="item in dataForm.people" :key="item._id">
					<view class="image">
						<image style="border-radius: 50%;" :src="item.avatarUrl" mode=""></image>
						<span>{{item.nickName}}</span>
					</view>
					<view class="money">
						<!-- {{dataForm.money}} -->
					</view>
				</view>
				<!-- <view class="people box">
					<view class="image">
						<image src="../../static/images/money.png" mode=""></image>
						<span>xxx</span>
					</view>
					<view class="money">
						{{dataForm.money}}
					</view>
				</view> -->
			</view>
			<view class="details box">
				<!-- 	<u-form-item label="账本:" prop="accID" ref="item1">

				</u-form-item> -->
				<u-form-item label="付款时间:" prop="time" ref="item1">
					{{dataForm.time}}
				</u-form-item>
				<u-form-item label="付款照片:" prop="img" ref="item1">
					<image @click="previewImage" :src="dataForm.img[0]" mode=""></image>
				</u-form-item>

			</view>
		</u--form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: "",
				dataForm: {
					"founder": "",
					"founderId": "",
					founderImg: '',
					"accID": "",
					"time": "",
					"money": "",
					"img": [],
					"type": "",
					"remark": "",
					people: []
				}
			}
		},
		onLoad(e) {
			console.log(e);
			this.id = e.id
			this.init()
		},
		methods: {
			previewImage(e) {
				let that = this
				uni.previewImage({
					urls: that.dataForm.img
				})
			},
			init() {
				let data = {
					id: this.id
				}
				this.$cloudApi.call({
					name: 'getbillDetails',
					data,
					success: res => {
						console.log(res);
						this.dataForm = res
					}
				});
			}
		}
	}
</script>

<style scoped lang="less">
	.billDetails {
		image {
			width: 100rpx;
			height: 100rpx;
		}

		.money {
			font-weight: bold;
		}

		.image {
			display: flex;
			align-items: center;

			span {
				margin-left: 30rpx;
			}
		}

		.box {
			padding: 15rpx 30rpx;
		}

		.header {
			background-color: #fff;

			.buttom {
				display: flex;

				.text {
					margin-left: 30rpx;
				}
			}

			.top {
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1px solid #f1f1f1;


			}
		}

		.founder {
			background-color: #fff;
			margin-top: 30rpx;

			.people {
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1px solid #f1f1f1;
			}

			.title {
				border-bottom: 1px solid #f1f1f1;
			}
		}

		.details {
			background-color: #fff;
			margin-top: 30rpx;
		}
	}
</style>